package com.example.weiba_app;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class MyCircleAdapter extends BaseAdapter{
	private Context context;
	private List<? extends Map<String, ?>> data;

	public View getView(int position, View convertView, ViewGroup parent) {
		
		RelativeLayout item = (RelativeLayout) View.inflate(context,R.layout.activity_mycir, null);
		RadioButton rbtn = (RadioButton) item.findViewById(R.id.onecircle);
		Map<String, String> map = (Map<String, String>) data.get(position);
		rbtn.setText(map.get("cirname"));
		//rbtn.
	    //ImageButton imgbtn = (ImageButton)item.findViewById(R.id.frilist_imageButton);
	    
	    InputStream ins;
		try {
			ins = MainActivity.getAssetManager().open("images/"+map.get("imageButton1"));
			Bitmap bitmap = BitmapFactory.decodeStream(ins);
			//imgbtn.setImageBitmap(bitmap);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
}

	@Override
	public int getCount() {
		return 0;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}
}
